UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+F8NZN4uQzv+SJ8JNpNySgX8vAF5PGDnr5Hd3v+kraI='
WHERE
key_id = '5e1c7ab92538023701851f28318d5682a63e6245fa5bdfe3f99c62da67b79b0c'
AND (
token = '+F8NZN4uQzv+SJ8JNpNySgX8vAF5PGDnr5Hd3v+kraI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)