UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2HDI2IZPckyQDL0UM39Q4AAJ+JwoaFIEDwL+D5VQSYE='
WHERE
key_id = '23000b2b4fa982576abb4a9c814ac9bc334c9215a9295e9e40c93c5727a08b26'
AND (
token = '2HDI2IZPckyQDL0UM39Q4AAJ+JwoaFIEDwL+D5VQSYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)