UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dc2907qS7+yKXyT+EIfrJ/RkcKervAzH/kDVShQNm2g=' 
WHERE 
  key_id = '05f5c5cc08079a9686bcc01810bd2a4a696ff8c584119fce0cd0fde49810048e' 
  AND (
    token = 'dc2907qS7+yKXyT+EIfrJ/RkcKervAzH/kDVShQNm2g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035