UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CuOFR1a16YKBisjrQuFi9GR1IwSvNx3mlA5ZzbfdA8s='
WHERE
key_id = 'e5e3e451ef5ebdfc1a3c9ad0e14a361bb1cd37f7eab404aa4267d2979e5f8267'
AND (
token = 'CuOFR1a16YKBisjrQuFi9GR1IwSvNx3mlA5ZzbfdA8s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)