UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ObiC0zY7EwVzSCbOUuUMpp60JapEVmYpufi+3AvPSxM='
WHERE
key_id = 'c32853ff9c9fa6cbca993e2bba43c1a94fa938ae89785ad0c22a82bd9474cd0b'
AND (
token = 'ObiC0zY7EwVzSCbOUuUMpp60JapEVmYpufi+3AvPSxM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)