UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ICEM9q3hVj6jIQziyulw8CxN+qngAIBbxb9uoO9fkIA='
WHERE
key_id = '43c6b8127f68863d911f1f9f8b8178fff4ffba912c9174d6bcbb84a2932a7927'
AND (
token = 'ICEM9q3hVj6jIQziyulw8CxN+qngAIBbxb9uoO9fkIA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)