UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ztvHwn9uH4AA5lUKudj2Z/4fySPcpKfO4V4ERqJf6no='
WHERE
key_id = '21e71ddccd814f678a8f1813e0a6f42536ca0afdeadb1fccf7a3ee0048b6a922'
AND (
token = 'ztvHwn9uH4AA5lUKudj2Z/4fySPcpKfO4V4ERqJf6no='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)