UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ry15UJ9AWxHhaiSP1lT0LW7v682nhNHcnpo6xVvLko4='
WHERE
key_id = 'eb43d7234e839e549784e197fee52ac6dd473a39182cd79412199809681ffc51'
AND (
token = 'Ry15UJ9AWxHhaiSP1lT0LW7v682nhNHcnpo6xVvLko4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)