UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U5bil8n9Uq4hW6bgG+bTJn2I2nCiZtAxmPDDhcH26e8='
WHERE
key_id = 'cfa458bc3c947f65853e8ed3ce1cffe2c429c1fea73b96b50ef73dc23afcba1b'
AND (
token = 'U5bil8n9Uq4hW6bgG+bTJn2I2nCiZtAxmPDDhcH26e8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)