UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4ExQiC5kXexKSm14WGsbhJUIjzpfa7DOZpaARgJmS9Y='
WHERE
key_id = 'd3ff333a30b19230ec9a902cf78784a415317c56891d3ec72a3dc506382f8c78'
AND (
token = '4ExQiC5kXexKSm14WGsbhJUIjzpfa7DOZpaARgJmS9Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)