UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8DdR1tIyYNYp/NlIc0z5+EfJt3rpgSlcmCwvZacvKAA='
WHERE
key_id = 'f13260cc1e4019774c1916d81cca5a6b2421007d2fdcced1850c4ed1bcc9e3a5'
AND (
token = '8DdR1tIyYNYp/NlIc0z5+EfJt3rpgSlcmCwvZacvKAA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)