UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pi2VpIVTRV1F7qHLNTP6KWvVwMJAqKphHfrpAG56wmY='
WHERE
key_id = '48fbe4ab5b925e178c42b77658a3bf22ffdcbcdafaabebfd0b1cef32a5ef86d2'
AND (
token = 'Pi2VpIVTRV1F7qHLNTP6KWvVwMJAqKphHfrpAG56wmY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)