UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TO4ZUGdRRLYOEiJY2fs+BaWxpk1xETtlcMMGaBXnuug='
WHERE
key_id = '6915334ba2ac46ff630331f075a042d148f7bc869cf8a6885c049a5c172447ba'
AND (
token = 'TO4ZUGdRRLYOEiJY2fs+BaWxpk1xETtlcMMGaBXnuug='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)