UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FIkqk2olCuCP0DHM1LoUVSbKBoQshtdp3p8h+OGfe10='
WHERE
key_id = 'e16ea270bc3f54e336fba28a28488bbfe1c42c8dfb8045894870e3b8c2ce3e62'
AND (
token = 'FIkqk2olCuCP0DHM1LoUVSbKBoQshtdp3p8h+OGfe10='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)