UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r7EhusfaMSs5xi0j9zmF9phxVRRKN46eU2l7VbooCOQ='
WHERE
key_id = '608b5c563c24401c0e107ebae104e896ffeea88fb5cf2e27cb9455ff9ca01435'
AND (
token = 'r7EhusfaMSs5xi0j9zmF9phxVRRKN46eU2l7VbooCOQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)