UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PwFzCIaMWk7hG5WlF6HnKkhbagXtdIaPtTaPZpMpgCg='
WHERE
key_id = '83c45da42dba1655cf131994fdfc867efa186f99b881208fb9eb067caafe6d59'
AND (
token = 'PwFzCIaMWk7hG5WlF6HnKkhbagXtdIaPtTaPZpMpgCg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)