UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OKO8Q4iArO1zhjoPTuqqBEwRj5kCrJmKwqOQ+6v4Kg4='
WHERE
key_id = '205360ee4a3d6b0ff565e6b52d7d4b24d0b80daee3f2e1c1869b34314e3badfa'
AND (
token = 'OKO8Q4iArO1zhjoPTuqqBEwRj5kCrJmKwqOQ+6v4Kg4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)