UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V68TNFloLAq6TMIKNVkKZOuKXBukjp1SS1rwv6pFLcE='
WHERE
key_id = '8f0ec62e7bae46c6e1d9cc0a1e36625977a41e42e5a57175edd5d48226fb5f4d'
AND (
token = 'V68TNFloLAq6TMIKNVkKZOuKXBukjp1SS1rwv6pFLcE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)