UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HIDOvh6f9NXnuUhWSjNmINVM6gFRTwdzQgGCGRoksxY='
WHERE
key_id = '455d93c0a133c2df242fe8a9b54f672255ba4dc47e02b391cf58f5df2de5dab9'
AND (
token = 'HIDOvh6f9NXnuUhWSjNmINVM6gFRTwdzQgGCGRoksxY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)