UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aMrxJmuuC9XvfSPYqieA1oeN4w765KpKXHr/9/ZHXc4=' 
WHERE 
  key_id = '7227cfb02a07eecbbe6b7f39216848d32d5ea4ca9dfdf579844ec066fb80e9c5' 
  AND (
    token = 'aMrxJmuuC9XvfSPYqieA1oeN4w765KpKXHr/9/ZHXc4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031