UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CLhlfj1J3U9ecbOciQTlf1Y3hICjVrgPJrW+rUIz2Bg='
WHERE
key_id = '1b0f013a0a3b7c196347b98fea551c3cddd22ec61dba91fa4ab0f3c0e8289d58'
AND (
token = 'CLhlfj1J3U9ecbOciQTlf1Y3hICjVrgPJrW+rUIz2Bg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)