UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N69HfExWaLGt6Iq+h9wcZzWIRNJV71lCwVkN8ymKEkQ='
WHERE
key_id = 'db45df0ac1b2cfbfa88295c2473f6fa6b9b2d630afe3f5f5144f90c488cdefe1'
AND (
token = 'N69HfExWaLGt6Iq+h9wcZzWIRNJV71lCwVkN8ymKEkQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)