UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HosfdJmj1CSbcUCp2fow/6cZOfz6R5FP2L2xO+e41A0=' 
WHERE 
  key_id = '811a4e108736b348bb6f961b1180bc9e4bfbe583a223a69613304876bd62b76b' 
  AND (
    token = 'HosfdJmj1CSbcUCp2fow/6cZOfz6R5FP2L2xO+e41A0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050