UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'En/ftEV0evHxUEhfM+4GA2pxkTCqZDVxLp5m0/3p7B0='
WHERE
key_id = 'fa36d1863e05671572989340d6650054ce26dca233bfedd7cbda1989f99058e3'
AND (
token = 'En/ftEV0evHxUEhfM+4GA2pxkTCqZDVxLp5m0/3p7B0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)