UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hk+ebrtdURalsVPYf/m5WEXCAk83wA1gV2YBw9TSQlM='
WHERE
key_id = '8106fa65c6c8428dfee9ced17b22b98ec9453bc0311e2d8d485216e6e1e8b33d'
AND (
token = 'hk+ebrtdURalsVPYf/m5WEXCAk83wA1gV2YBw9TSQlM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)