UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ihjWEd3b7e4wtBrDxAGt75SQHKfGFFb+PLFDoCK96G8='
WHERE
key_id = '1564d90735f95da3d0ae1e5ae682f9c6e4caaa4692b80cdefc37ddbbb15fc149'
AND (
token = 'ihjWEd3b7e4wtBrDxAGt75SQHKfGFFb+PLFDoCK96G8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)