UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4tAZeJri+wdQI2pHShUauqQWuQ4TSVzNWPLqBRQ2G50='
WHERE
key_id = '1760c40d1410a0b56968f6012e59fa90413056499c2e3d79c5cc02cedb3bbc45'
AND (
token = '4tAZeJri+wdQI2pHShUauqQWuQ4TSVzNWPLqBRQ2G50='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)