UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xunIINIdR5RzHDssrCA+Sv5I4fzOBZSYKxt/EfYNHfQ='
WHERE
key_id = '1042e39e80aaa131054b61061acf018fd8ecc1acdc477cb14c3388936b85acbc'
AND (
token = 'xunIINIdR5RzHDssrCA+Sv5I4fzOBZSYKxt/EfYNHfQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)