UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dqzofGaQkaK5f0qczIqwYO3mCrIVx3wMVldXKau1p5g=' 
WHERE 
  key_id = '6a2902f7fd3e1a7d073f24c4ed80e70d6b9af11f955e2f8b115379c20879b899' 
  AND (
    token = 'dqzofGaQkaK5f0qczIqwYO3mCrIVx3wMVldXKau1p5g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024